package com.example.doctorstation.POJOMapper;

import com.example.doctorstation.POJOData.User;
import java.util.List;
import org.apache.ibatis.annotations.*;

@Mapper
public interface UserMapper {
    //查询所有用户
    @Select("select * from config_user")
    public List<User> getAllUsers();

    //判断用户登录
    @Select("select userId,userName,deptId from config_user where userid = #{arg0} and password = #{arg1}")
    public User getUser(int userid, String password);

    @Select("select userId, userName, password, roleId, deptId from config_user where userName = #{userName}")
    User findByUserName(String userName);

    @Select("select doctorname from config_doctor doctor where doctor.doctorid=#{userId} ")
    String findDoctorNameByUserId(int userId);
}